                               <!-- Script réalisé par BOUFTIH FADWA -->
<?php
include_once('beans/reclamationBean.php');
include_once('connectBD.php');

class reclamationDao{
	public $listeReclamation= array();
  public function loadAllReclamation(){//fct pour recuperer tous les reclamations
    $req1=connexion()->prepare("select * from reclamation");
    $req1->execute();
    $reclamation=new reclamationBean();
    while($row = $req1->fetch(PDO::FETCH_OBJ)) {
       $reclamation->setIdReclamation(utf8_encode($row->idReclamation));
       $reclamation->setDescription(utf8_encode($row->description));
       $reclamation->setDesignation(utf8_encode($row->designationTache));  
       $reclamation->setDateReclamation(utf8_encode($row->dateReclamation));
       $reclamation->setetat(utf8_encode($row->etat));
       $reclamation->setIdNomade(utf8_encode($row->idNomade));
       $listeReclamation[]=$reclamation;
    }
    return $listeReclamation;//return liste des reclamations

    }
    //fct pour suprimer la reclamation
 public function  deleteReclamation($reclamation)  {
   $id_sup=$reclamation->getIdReclamation();
  $requete_supression=connexion()->exec("DELETE FROM reclamation where idReclamation=$id_sup");
}   
}

?>